package com.entity;

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * AccpGrade entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ACCP_GRADE", schema = "ACCP")
public class AccpGrade implements java.io.Serializable {

	// Fields

	private BigDecimal gid;
	private AccpBiz accpBiz;
	private String gname;
	private Set<AccpSubject> accpSubjects = new HashSet<AccpSubject>(0);
	private Set<AccpClass> accpClasses = new HashSet<AccpClass>(0);

	// Constructors

	/** default constructor */
	public AccpGrade() {
	}

	/** minimal constructor */
	public AccpGrade(BigDecimal gid) {
		this.gid = gid;
	}

	/** full constructor */
	public AccpGrade(BigDecimal gid, AccpBiz accpBiz, String gname,
			Set<AccpSubject> accpSubjects, Set<AccpClass> accpClasses) {
		this.gid = gid;
		this.accpBiz = accpBiz;
		this.gname = gname;
		this.accpSubjects = accpSubjects;
		this.accpClasses = accpClasses;
	}

	// Property accessors
	@Id
	@Column(name = "GID", unique = true, nullable = false, precision = 22, scale = 0)
	public BigDecimal getGid() {
		return this.gid;
	}

	public void setGid(BigDecimal gid) {
		this.gid = gid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "BIZID")
	public AccpBiz getAccpBiz() {
		return this.accpBiz;
	}

	public void setAccpBiz(AccpBiz accpBiz) {
		this.accpBiz = accpBiz;
	}

	@Column(name = "GNAME")
	public String getGname() {
		return this.gname;
	}

	public void setGname(String gname) {
		this.gname = gname;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpGrade")
	public Set<AccpSubject> getAccpSubjects() {
		return this.accpSubjects;
	}

	public void setAccpSubjects(Set<AccpSubject> accpSubjects) {
		this.accpSubjects = accpSubjects;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpGrade")
	public Set<AccpClass> getAccpClasses() {
		return this.accpClasses;
	}

	public void setAccpClasses(Set<AccpClass> accpClasses) {
		this.accpClasses = accpClasses;
	}

}